package com.qiaofang.applet.service.member.service.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * Created by IDEA.
 *
 * @auther Zym.
 * @company qiaofang
 * @date 2021/1/11 17:06
 */
@Data
@ApiModel("我的预约列表查询DTO")
public class MyAppointmentListDto {

    @ApiModelProperty("数据主键id")
    private String id;

    @ApiModelProperty("会员id")
    private String memberId;

    @ApiModelProperty("会员手机号")
    private String memberPhone;

    @ApiModelProperty("预约经纪人唯一uuid")
    private String employeeUniqueUuid;

    @ApiModelProperty("预约经纪人名称")
    private String employeeName;

    @ApiModelProperty("业务类型：1 新房  2 二手房  3 租房")
    private Integer businessType;

    @ApiModelProperty("房源唯一UUID")
    private String businessUuid;

    @ApiModelProperty("房源名称")
    private String businessName;

    @ApiModelProperty("城市名称")
    private String cityName;

    @ApiModelProperty("区域名称")
    private String districtName;

    @ApiModelProperty("预约姓名")
    private String appointmentName;

    @ApiModelProperty("随访人数")
    private Integer visitorNum;

    @ApiModelProperty("预约手机号")
    private String appointmentPhone;

    @ApiModelProperty("加密预约手机号")
    private String encryptionPhone;

    @ApiModelProperty("预约时间 yyyy-MM-dd HH:mm")
    private String appointmentTime;

    @ApiModelProperty("用户提交时间")
    private String createTime;

    @ApiModelProperty("实际看房时间  yyyy-MM-dd HH:mm")
    private String visitTime;

    @ApiModelProperty("城市CODE")
    private String cityCode;

    public String getEncryptionPhone() {
        if (StringUtils.isEmpty(appointmentPhone)) {
            return "";
        }
        return appointmentPhone.substring(0, 3) + "****" + appointmentPhone.substring(7, 11);
    }
}
